package com.ssy.lingxi.product.api.feign;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.product.api.model.request.warehouse.InventoryByProductIdRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 仓位管理
 *
 * @author wrc
 * @date 2020/9/7
 */
@FeignClient(name = "product-service")
public interface FreightSpaceControllerFeign {

    /**
     * 扣除仓位库存
     */
    @PostMapping("/product/deduct/inventory")
    Wrapper<Void> deductInventory(@RequestBody InventoryByProductIdRequest request);


    /**
     * 返回库存
     * @author wrc
     * @date 2020/9/16
     */
    @PostMapping("/product/deduct/return")
     Wrapper<Void> deductReturn(@RequestBody InventoryByProductIdRequest request);

    /**
     *查询商品的仓位库存-内部
     * memberId 采购商ID
     * memberRoleId 采购商ID
     * productId 商品ID
     * shopId 商城ID
     */
    @GetMapping("/product/stock/byProductId/inside")
    Wrapper<Double>  stockByProductIdInside(@RequestParam(value = "productId") Long productId,@RequestParam(value = "shopId")Long shopId,@RequestParam(value = "memberId")Long memberId,@RequestParam(value = "memberRoleId")Long memberRoleId);
}
